/****** Object:  Table [FeedbackUser]    Script Date: 07/07/2012 20:47:48 ******/
--IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[FK__FeedbackU__Regis__1273C1CD]') AND parent_object_id = OBJECT_ID(N'[FeedbackUser]'))
--ALTER TABLE [FeedbackUser] DROP CONSTRAINT [FK__FeedbackU__Regis__1273C1CD]
--GO
/****** Object:  Table [FeedbackUser]    Script Date: 07/07/2012 20:47:48 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[FeedbackUser]') AND type in (N'U'))
DROP TABLE [FeedbackUser]
GO
/****** Object:  Table [FeedbackUser]    Script Date: 07/07/2012 20:47:48 ******/
PRINT 'CREATING TABLE .... [FeedbackUser]'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[FeedbackUser]') AND type in (N'U'))
BEGIN

CREATE TABLE [dbo].[FeedbackUser](
	[FeedbackUserKey] [int] IDENTITY(1,1) NOT NULL,
	[FeedbackUserName] [varchar](50) NOT NULL,
	[FeedbackUserEmail] [varchar](50) NOT NULL,
	[RegisteredUserKey] [int] NULL,
	[Sys_DateOfCreation] [datetime] NOT NULL,
	[Sys_DateOfModification] [datetime] NOT NULL,
	[Sys_CreatedByID] [varchar](50) NOT NULL,
	[Sys_ModifiedByID] [varchar](50) NOT NULL,
	[Sys_DeleteType] [int] NOT NULL,
	[Sys_IsDeleted] [bit] NOT NULL,
	[Sys_OrganizationID] [int] NOT NULL,
	[Sys_InitialPrimaryKeys] [varchar](max) NULL,
	[Sys_WorkstationName] [varchar](50) NULL,
 CONSTRAINT [PK_FeedbackUser] PRIMARY KEY CLUSTERED 
(
	[FeedbackUserKey] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [Unique_FeedbackUser] UNIQUE NONCLUSTERED 
(
	[FeedbackUserEmail] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

END
GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [FeedbackUser] SET (LOCK_ESCALATION = AUTO)
GO

--ALTER TABLE [FeedbackUser]  WITH CHECK ADD FOREIGN KEY([RegisteredUserKey])
--REFERENCES [User] ([UserKey])
--GO